package battleships;
/**
* Title: AI
* Description: AI system for battleship
* @mainauthor: Jake Kooiman
* @email jake.kooiman@my.uwrf.edu
* @editors:
* @lastupdate: 12/1/11
* 
*/


import java.util.*;




public class AI {
// Fired on is a collection of places that the AI has already fired, so it won't fire there again.
	Set<Integer> FiredOn = new HashSet<Integer>();
	int Target;
	
	public void main(String[] args) {
		Fire();
		
	}
	public void Fire(){
		AITargeting();
		while(FiredOn.contains(Target))
			AITargeting();
		
		FiredOn.add(Target);
	}
//	A random number from 1 to 100 is selected to target, then is sent back to main.
	public void AITargeting(){
		 Random RandomNum = new Random();
		 Target = RandomNum.nextInt(10) + 1;
	}
	
	public Integer Getter(){
		return Target;
	}
	
	

}
